IDLE Extentions package import IdleXlib is calling idlelib.configHandler module NOT Found

by: GMRsr, 7 years ago

Last edited: 7 years ago

Imported IdleX which is an extension package which includes IDLE2HTML which is supposed to allow you to print a py script to an HTML file preserving color coding.  Import  idlexlib gives an error that says it is trying to call idlelib.configHandler to import two other files (idleConf and idleConfParser). 'from idlexlib import IDLE2HTML' also gives the same error. I believe that IDLE2HTML is supposed to create a 'save' option in the IDLE window to 'save to HTML.'  My IDLE does not show this. In C:PythonPython36-32Libsite-packages idlexlib>extentions>[about 25 '.py' files including IDLE2HTML].  Has anyone ever tried to install IdleX successfully?  http://idlex.sourceforge.net/extensions.html

installed in python36 using cmd windows cmd prompt> python setup.py install

Then calling the module from idle:  

[
>>> import idlexlib
Traceback (most recent call last):
  File "<pyshell#3>", line 1, in <module>
    import idlexlib
  File "C:PythonPython36-32libsite-packagesidlexlib__init__.py", line 10, in <module>
    from .idlexMain import version as __version__
  File "C:PythonPython36-32libsite-packagesidlexlibidlexMain.py", line 46, in <module>
    from idlexlib.extensionManager import extensionManager
  File "C:PythonPython36-32libsite-packagesidlexlibextensionManager.py", line 60, in <module>
    from idlelib.configHandler import idleConf, IdleConfParser
ModuleNotFoundError: No module named 'idlelib.configHandler'
]


UPDATED INFO:
I opened the file 'extensionManager.py' to see the call to import the files  idleConf, IdleConfParser.  

from idlelib.configHandler import idleConf, IdleConfParser

These two files exist in idlelib > config.py

However, when you edit the script of 'extensionManager.py' to be:  'import idlelib'  then the two classes:  IdleConf and IdleConfParser that exist in config.py do not both cause an error, but for some reason class IdleConf is not able to be imported:

RESTART: C:PythonPython36-32Libsite-packagesidlexlibextensionManager.py
Traceback (most recent call last):
  File "C:PythonPython36-32Libsite-packagesidlexlibextensionManager.py", line 62, in <module>
    from idlelib import IdleConf, IdleConfParser
ImportError: cannot import name 'IdleConf'



You must be logged in to post. Please login or register an account.



Hmm, I am not familiar with this package, but, when you see something like ImportError: cannot import name 'IdleConf' it means that package/lib/file doesn't exist, but it's expected to. Why that's the case right now for you, I do not know, but you can try to pip install idleconf and see what happens.

All that said, let's go back to your original "which is supposed to allow you to print a py script to an HTML file preserving color coding."

If that's your goal, use prettyprint/prettify!

https://github.com/google/code-prettify

That's what I use here on pythonprogramming.net for these purposes. Read the readme, you just need to have that script tag, then you use the pre tags.



-Harrison 7 years ago

You must be logged in to post. Please login or register an account.